
package com.itheima.domain.utils;


/**
 * @author: Sch
 * @Date: 2025/07/18 15:14
 * @Description:
 */

public class ThreadLocalUtils {
    private static final ThreadLocal<Integer> THREAD_LOCAL = new ThreadLocal<>();


/**
     * 向当前线程中设置一个ID
     */

    public static void set (Integer id) {
        THREAD_LOCAL.set(id);
    }


/**
     * 获取当前线程中的ID
     */

    public static Integer get () {
        return THREAD_LOCAL.get();
    }


/**
     * 删除当前线程中的ID
     */

    public static void remove () {
        THREAD_LOCAL.remove();
    }

}

